package de.baumann.browser.fragments.duobao

import android.view.View
import de.baumann.browser.activitys.duobao.JieXiaoDetailActivity
import de.baumann.browser.adapter.DuoBaoJieXiaoOrderAdapter
import kotlinx.android.synthetic.main.fragment_order.*

class OrderJieXiaoFragment : OrderFragment() {
    companion object {
        val instance: OrderJieXiaoFragment by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
            OrderJieXiaoFragment()
        }
    }

    override fun initView(view: View) {
        duoBaoOrderAdapter = DuoBaoJieXiaoOrderAdapter()
        duobaoOrderList.adapter = duoBaoOrderAdapter
        duoBaoOrderAdapter.setOnItemClickListener { _, _, position ->
            val duobao = duoBaoOrderAdapter.getItem(position)
            JieXiaoDetailActivity.startJieXiaoDetailActivity(mContext,duobao!!.activityId.toString(),duobao.phaseNum.toString())
        }
    }

    override fun initData() {
        getPresenter().yiJieXiaoDingDan()
    }
}